<!doctype html>
<meta charset="utf-8">
<title>Test pseudo elements parsing of valid selectors</title>
<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m">
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
<script>
const functionPseudoElements = [
    "::view-transition-group",
    "::view-transition-image-pair",
    "::view-transition-old",
    "::view-transition-new",
];

function test_valid_selector_combinations(pseudo) {
    test_valid_selector(pseudo);
    test_valid_selector(`:root${pseudo}`);
    test_valid_selector(`.a${pseudo}`);
    test_valid_selector(`div ${pseudo}`);
}

test_valid_selector_combinations("::view-transition");

for (const functionName of functionPseudoElements) {
    for (const validArgument of ["*", "root", "dashed-ident"]) {
        test_valid_selector_combinations(`${functionName}(${validArgument})`);
        test_valid_selector_combinations(`${functionName}(${validArgument}):only-child`);
    }
}
</script>
